package com.oracle.calligraphy.controller;

import com.oracle.calligraphy.entity.ArtmarketEntity;
import com.oracle.calligraphy.service.ArtmarketService;
import com.oracle.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.Map;



/**
 *
 *
 * @author oracle
 * @email @qq.com
 * @date 2024-07-05 15:21:49
 */
@RestController
@RequestMapping("calligraphy/artmarket")
public class ArtmarketController {
    @Autowired
    private ArtmarketService artmarketService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){


        return R.ok();
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
		ArtmarketEntity artmarket = artmarketService.getById(id);

        return R.ok(artmarket);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody ArtmarketEntity artmarket){
		artmarketService.save(artmarket);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody ArtmarketEntity artmarket){
		artmarketService.updateById(artmarket);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
		artmarketService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
